//
//  DDJobfinderInfoCell.m
//  DingDongZP
//
//  Created by Jyh on 16/5/2.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

#import "DDJobfinderInfoCell.h"

@implementation DDJobfinderInfoCell

- (void)awakeFromNib {
    // Initialization code
    self.detailView.layer.cornerRadius = 5;
    self.detailView.layer.borderColor = COLOR_BORDER_GRAY.CGColor;
    self.detailView.layer.borderWidth = 0.5;
    
    self.avatarImage.layer.cornerRadius = CGRectGetWidth(self.avatarImage.frame)/2;
    self.avatarImage.layer.masksToBounds = YES;
    
    self.nameLabel.text = @"";
    self.experienceLabel.text = @"";
    self.jobTitleLabel.text = @"";
    self.stateLabel.text = @"";
    self.experienceLabel.text = @"";
    self.jobTitleLabel.text = @"";
    
    self.sexLabel.text = @"";
    self.cityLabel.text = @"";
    self.eduLabel.text = @"";
    self.salaryLabel.text = @"";
    self.expectIndustryLabel.text = @"";
}

- (void)updateInfoWith:(DDJobfinderDetailInfo *)detailInfo
{
    self.nameLabel.text = detailInfo.name;
    self.stateLabel.text = detailInfo.status;
    self.sexLabel.text = detailInfo.sex;
    if ([detailInfo.sex isEqualToString:@"男"]) {
        self.sexImageView.image = [UIImage imageNamed:@"common_icon_male"];
    } else {
        self.sexImageView.image = [UIImage imageNamed:@"common_icon_female"];
    }
    [self.avatarImage sd_setImageWithURL:[NSURL URLWithString:[DDAPIGenerate imageURLWithPath:detailInfo.logo]] placeholderImage:[UIImage imageNamed:@"common_avatar"]];
    self.cityLabel.text = detailInfo.expectcity;
    self.eduLabel.text = detailInfo.edu;
    self.experienceLabel.text = detailInfo.experience;
    self.jobTitleLabel.text = detailInfo.expectjobcategory;
    self.salaryLabel.text = [NSString stringWithFormat:@"￥%@",detailInfo.expectsalary];
    
    // 期望行业
    NSString *expectIndustring = [detailInfo.expectjobindustries componentsJoinedByString:@"|"];
    
    self.expectIndustryLabel.text = [NSString stringWithFormat:@"期望行业  %@",expectIndustring];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
